<?php 
class eventclass_sales_orders  extends eventsBase
{ 
	function eventclass_sales_orders()
	{
	// fill list of events
		$this->events["BeforeDelete"]=true;


//	onscreen events

	}
// Captchas functions	

//	handlers

		
		
		
		
		
		
		
		
		
		
		
				// Before record deleted
function BeforeDelete($where,&$deleted_values,&$message)
{

		    

// Place event code here.
// Use "Add Action" button to add code snippets.

global $conn;
$str = "select id from sales_orders where ".$where;
$rs = db_query($str,$conn);
$data = db_fetch_array($rs);

$strDelete = "delete from sales_order_items where sales_order_id=".$data['id'];
db_exec($strDelete,$conn);
return true;
;		
} // function BeforeDelete

		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
//	onscreen events

} 
?>
